package io.github.talelin.latticy.utils;

import org.springframework.beans.factory.annotation.Value;

import java.time.LocalDateTime;
import java.util.Calendar;

public class AcceptUtil {
    // B3230651812529
    private static String[] yearCodes = {"2019","2020","2021","2022","2023","2024","2025","2026","2027","2028","2029"};

    public static String makeAcceptNo() {
        StringBuffer joiner = new StringBuffer();
        Calendar calendar = Calendar.getInstance();
        joiner.append(AcceptUtil.yearCodes[calendar.get(Calendar.YEAR) - 2019])
                .append(Integer.toHexString(calendar.get(Calendar.MONTH)+1).toUpperCase())
                .append(String.format("%02d", calendar.get(Calendar.DAY_OF_MONTH)));
        return joiner.toString();
    }


}
